<?php
declare (strict_types=1);

namespace app\admin\validate;

use think\Validate;

class User extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        "rname" => "require",
        "mobile" => "require|mobile",
        "sex" => "require",
        "age" => "require",
        "birth" => "require",
        "id_card" => "require|idCard",
        "content" => "require",
        "cate" => "require",
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [
        'rname.require' => '请输入姓名',
        'mobile.require' => '请输入手机号',
        'mobile.mobile' => '手机号格式错误',
        'sex.require' => '请选择性别',
        'age.require' => '请输入年龄',
        'birth.require' => '请输入生日',
        'id_card.require' => '请输入身份证号码',
        'id_card.idCard' => '身份证号码格式错误',
        'content.require' => '请填写工作经历',
        'cate.require' => '请选择课程等级'
    ];
}
